package cn.edu.zafu.bigdata.lhff;

import java.util.HashMap;

public class StudentGradeManager {
    private final HashMap<String, Integer> studentGrades;

    public StudentGradeManager() {
        studentGrades = new HashMap<>();
    }

    public void addStudent(String name, int grade) {
        studentGrades.put(name, grade);
    }

    public int getGrade(String name) {
        return studentGrades.getOrDefault(name, -1);
    }

    public void removeStudent(String name) {
        studentGrades.remove(name);
    }

    public static void main(String[] args) {
        StudentGradeManager manager = new StudentGradeManager();
        manager.addStudent("小白", 86);
        manager.addStudent("小紫", 90);
        manager.addStudent("小蓝", 84);
        System.out.println("小白的成绩: " + manager.getGrade("小白"));
        System.out.println("小紫的成绩: " + manager.getGrade("小紫"));
        System.out.println("小蓝的成绩: " + manager.getGrade("小蓝"));
        System.out.println("小黄的成绩: " + manager.getGrade("小黄"));
        manager.removeStudent("小紫");
        System.out.println("小紫的成绩（删除后）: " + manager.getGrade("小紫"));
    }
}
